#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
//https://ac.nowcoder.com/acm/problem/22196
using namespace std;

const int N = 10010;
int n;
int b[N];
int sum;
int main()
{
	cin >> n;


	for (int i = 1; i <= n / i; ++i)
	{
		if (n % i == 0)
		{
			sum += i;
			sum += n / i;
		}
	}
	cout << sum << endl;

	return 0;
}